var express = require("express");
var router = express.Router();

const Admin = require("../models/adminModel.js");
const { 
    adminlogin, adminregister,
    showadmin,addadmin,deleteadmin,getadminid,updateadmin

 } = require("../controllers/admin.js");

//登陆
router.post('/login', adminlogin);
//注册
router.post('/register',adminregister);

//渲染数据
router.get('/',showadmin );
//添加
router.post('/',addadmin);
//删除
router.delete('/',deleteadmin);

//获取admin-id
router.get('/:_id',getadminid);
//修改
router.put('/',updateadmin);
 
module.exports = router;